<? include(APPPATH . "views/admin/header.php"); ?>
<? include(APPPATH . "views/admin/sidebar.php"); ?>

<div class="span10">
    <form class="form-horizontal" action="<?= site_url("clientes/novo") ?>" method="post" enctype="multipart/form-data">
        <h1>Novo Cliente</h1>
        <? if(isset($mensagem)): ?>
        <div class="alert <?= $erro ? "alert-error":"alert-success" ?>">
            <?= $mensagem ?>
        </div>
    <? endif; ?>
        <legend>Dados Basicos</legend>
        <div class="control-group">
            <label class="control-label">Nome:</label>
            <div class="controls">
                <input type="text" name="nome">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">CPF / CNPJ:</label>
            <div class="controls">
                <input type="text" name="cpfCnpj"> 
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">RG:</label>
            <div class="controls">
                <input class="input-small" type="text" name="rg"> 
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Orgão Emissor:</label>
            <div class="controls">
                <input class="input-mini" type="text" name="rgOrgao"> 
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Email:</label>
            <div class="controls">
                <input type="text" name="email"> 
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Telefone:</label>
            <div class="controls">
                <input class="input-small" type="text" name="telefone"> 
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Celular:</label>
            <div class="controls">
                <input class="input-small" type="text" name="celular"> 
            </div>
        </div>
        <legend>Endereço</legend>
        <div class="control-group">
            <label class="control-label">Rua:</label>
            <div class="controls">
                <input type="text" name="rua">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Nº:</label>
            <div class="controls">        
                <input class="input-mini" type="text" name="numero">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Complento:</label>
            <div class="controls">
                <input type="text" name="complemento">
            </div>
        </div>
        <div class="control-group">        
            <label class="control-label">Bairro:</label>
            <div class="controls">
                <input type="text" name="bairro">
            </div>
        </div>
        <div class="control-group">        
            <label class="control-label">CEP:</label>
            <div class="controls">
                <input class="input-small" type="text" name="cep">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Estado:</label>
            <div class="controls">
                <select class="chosen" id="input-estado" name="estado">
                    <? foreach ($estados as $estado): ?>
                        <option value="<?= $estado->getId() ?>"><?= $estado->getNome() ?></option>
                    <? endforeach; ?>
                </select>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Cidade:</label>
            <div class="controls">
                <select class="chosen" id="input-cidade" name="cidade">
                    <? foreach ($cidades as $cidade): ?>
                        <option value="<?= $cidade->getId() ?>"><?= $cidade->getNome() ?></option>
                    <? endforeach; ?>
                </select>
            </div>
        </div>
        <div class="form-actions">
            <button type="submit" class="btn btn-large btn-primary">
                <i class="icon-align-left icon-hdd icon-white"></i> Salvar
            </button>           
        </div>

    </form>
</div>
<? include(APPPATH . "views/admin/footer.php"); ?>